<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<link type="text/css" href="/js/selectator/fm.selectator.jquery.css" rel="stylesheet" >
<script type="text/javascript" src="/js/selectator/fm.selectator.jquery.js"></script>
<script type="text/javascript" src="/js/selectator/select_tags.js"></script>
<style>
<!--
#selectTagsAjax{
	width: 350px;
	height: 36px;
}
-->
</style>
<c:forEach items="${tags }"  var="tag">
<input type="hidden" name="selectTagsAjaxSelected" value="${tag.tagId}" label="${tag.name }"/>
</c:forEach>
<select id="selectTagsAjax" name="tags" multiple></select>
<br>
<span id="new_tags_input_span" style="">
<input type="text" name="newtags" value="${newtags}" placeholder="下拉选项中没有要找的标签，可以在这里补充，多个之间以逗号分隔" size="70" style="margin: 3px 10px;"/>
<a href="javascript:void(0);" class="js-manager-tags">标签管理</a>
</span>
<script type="text/javascript">
$(document).ready(function(){
	$('.js-manager-tags').click(function(){
		window.location.href="/tags";
	});
	var listForm = $('#listForm');
	if(listForm.length > 0){
		//如果有搜索列表，则标签选择框中不应该有输入框
		var tagInput = $('#new_tags_input_span');
		if(tagInput){
			tagInput.remove();
		}
	}
});
</script>